package com.co.view;

import javax.swing.JFrame;

import com.co.controller.GlobalConfigurationManager;
import com.co.controller.ViewManager;
import com.co.utils.Logger;

public class Startup {

	private JFrame initialPage = null;

	public Startup() {
	}

	private static Startup startupInstance;

	public static Startup getInstance() {
		if (startupInstance == null) {
			startupInstance = new Startup();
		}
		return startupInstance;
	}

	public static void main(String[] args) {

		Logger.activateLogger();

		configure();

		ViewManager viewManager = ViewManager.getInstance();
		viewManager.goToPage(IndexPage.getInstance().getId());
	}

	public static void configure() {
		GlobalConfigurationManager gcm = GlobalConfigurationManager
				.getInstance();
		gcm.configureLookAndFeel();
	}

	public void setInitialPage(JFrame initialPage) {
		this.initialPage = initialPage;
	}

	public JFrame getInitialPage() {
		return this.initialPage;
	}

	public void run(Startup startup) {
		startup.getInitialPage().setVisible(true);
	}
}